Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add timestamp query example #472

Merged
merged 5 commits into from
Nov 14, 2024

Conversation

eliemichel
Copy link
Contributor

Add an example that issues a single draw call of a cube (taken from the texturedCube example) and measures its duration thanks to timestamp queries.

sample/timestampQuery/main.ts Outdated Show resolved Hide resolved
sample/timestampQuery/main.ts Outdated Show resolved Hide resolved
sample/timestampQuery/main.ts Outdated Show resolved Hide resolved
src/samples.ts Outdated Show resolved Hide resolved
sample/timestampQuery/main.ts Show resolved Hide resolved
sample/timestampQuery/main.ts Outdated Show resolved Hide resolved
@eliemichel
Copy link
Contributor Author

Thanks for the feedback! 🙏

Copy link
Collaborator

@kainino0x kainino0x left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Split LGTM, just one comment!

sample/timestampQuery/TimestampQueryManager.ts Outdated Show resolved Hide resolved
@kainino0x kainino0x enabled auto-merge (squash) November 14, 2024 23:42
@kainino0x
Copy link
Collaborator

Thank you!

@kainino0x kainino0x merged commit f8ed72a into webgpu:main Nov 14, 2024
1 check passed
@eliemichel eliemichel deleted the eliemichel/timestampQuery branch November 15, 2024 09:09
@beaufortfrancois
Copy link
Collaborator

As you can see in https://developer.chrome.com/blog/new-in-webgpu-121#timestamp_queries_in_compute_and_render_passes and https://webgpu.github.io/webgpu-samples/?sample=computeBoids, there was already a sample featuring timestamp-query.

Note that since we moved to a white background iframe, the text on large desktop didn't show up properly. I'm fixing it with #477

@greggman
Copy link
Collaborator

greggman commented Nov 15, 2024

Note that since we moved to a white background iframe,

We did not move to a white background iframe. It's was a bug in Chrome. It's not fixed still but there's a workaround #478

It's possible #477 is not need with #478 added?

@eliemichel
Copy link
Contributor Author

As you can see in https://developer.chrome.com/blog/new-in-webgpu-121#timestamp_queries_in_compute_and_render_passes and https://webgpu.github.io/webgpu-samples/?sample=computeBoids, there was already a sample featuring timestamp-query.

The journey I followed is (a) "oh I need to quickly test a thing with timestamp queries" (b) "mmh I remember there is this nice sample repo where I can find examples, let's look for one about timestamps" (c) "arf, don't find an example whose name says "timestamp"... maybe in benchmark section? nope" (d) "okey then, let's write it then and share it back where I expected to find it". :)

@beaufortfrancois
Copy link
Collaborator

As you can see in https://developer.chrome.com/blog/new-in-webgpu-121#timestamp_queries_in_compute_and_render_passes and https://webgpu.github.io/webgpu-samples/?sample=computeBoids, there was already a sample featuring timestamp-query.

The journey I followed is (a) "oh I need to quickly test a thing with timestamp queries" (b) "mmh I remember there is this nice sample repo where I can find examples, let's look for one about timestamps" (c) "arf, don't find an example whose name says "timestamp"... maybe in benchmark section? nope" (d) "okey then, let's write it then and share it back where I expected to find it". :)

I apologize if my previous message came across as harsh. That was not my intention. I realize that I could have been clearer in the title by specifying that it involved timestamp queries. I take full responsibility for this oversight.

@eliemichel
Copy link
Contributor Author

I apologize if my previous message came across as harsh. That was not my intention. I realize that I could have been clearer in the title by specifying that it involved timestamp queries. I take full responsibility for this oversight.

No worry, really :)

@kainino0x
Copy link
Collaborator

We have a little (HDR) on the particles demo that it also demonstrates HDR. I have been thinking we should formalize this and start listing all of the extra things that each sample demonstrates in the sidebar. I forgot we had another one that was undiscoverable here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants